<?php 
  session_start();  
?>
<html>
<body> 
<?php
include("Validator.php");
   
if (!empty($_POST)){
	$pole = array();
$x=validPasswd($_POST['jmeno']);
if ($x==0){  
  $pole['jmeno'] = 'Chyba ve jmenu';
} 
}   	    

if (isset($pole)){
if (!empty($pole)){
foreach ($pole as $k){
echo "<div>  " . $k . "</div><br/>";
echo "<meta http-equiv='refresh' content='5;url=index.php'>";
}
}
else{   

   $jmeno=$_POST['jmeno'];
   $_SESSION['jmeno']=$jmeno;
   $_SESSION['mazani']=true;

echo "<meta http-equiv='refresh' content='1;url=kroldva.php'>";	   	    
  	    
}
} 
?> 
</body>
</html> 